use diesel::{r2d2::{ConnectionManager, Pool}, MysqlConnection};

use self::db::create_r2d2_mysql_conn_pool;

mod db;

pub struct AppWebData {
    pub db_conn_pool: Pool<ConnectionManager<MysqlConnection>>,
}

pub fn create_app_web_data() -> AppWebData {
    let db_conn_pool = create_r2d2_mysql_conn_pool("mysql://root:!Flytek@2022@172.30.93.241:3306/aiobs_mock");
    AppWebData {
        db_conn_pool: db_conn_pool,
    }
}
